package com.blog.service;

import com.blog.mapper.ShippingMapper;
import com.blog.seckill.shippings.Shipping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ShipsBaseService
 * @Destription Ships基础：增删改查
 * @Author 天堂小野花
 * @Date 2025/8/19  18:38
 * @Version 1.0
 */
@Service
public class ShippingBaseService {
    @Autowired
    ShippingMapper shippingMapper;
    //表 Shipping
    public Shipping selectShippingById(Long id){
        return shippingMapper.selectByPrimaryKey(id);
    }
    public int insertShipping(Shipping shipping){
        return shippingMapper.insert(shipping);
    }
    public int updateShipping(Shipping shipping){
        return shippingMapper.updateByPrimaryKeySelective(shipping);
    }
    public int deleteShippingById(Long id){
        return shippingMapper.deleteByPrimaryKey(id);
    }

    public List<Shipping> selectAllShipping() {
        return shippingMapper.selectAllShipping();
    }
}
